﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Engine.Sgml.Validation;
using Engine.Sgml.Validation.Rules;
using Engine.Sgml.Merging;
using Engine.Sgml.Matching;
using Engine.Dtd.Schema;

namespace Engine.Sgml.Allocation {
    internal sealed class BlocksAllocationStrategy : IAllocationStrategy {

        public void Allocate(IList<BlockItem> blocks, AllocationContext context) {
            Guard.ArgumentNotNull(blocks, "blocks");
            Guard.ArgumentNotNull(context, "context");
            Debug.Assert(blocks.Count > 0);

            IBlockAllocator allocator = context.GetBlockAllocator("BlockAllocator");
            for (int i = 0; i < blocks.Count; i++) {
                allocator.Allocate(blocks[i], context);
                }
            }
        }
    }